#ifndef GPSRECORDER_H
#define GPSRECORDER_H

#include <QWidget>
#include <QFile>
#include <QApplication>
#include "recordconfig.h"
#include <QFileDialog>
#include <QDateTime>
#include <QShowEvent>
#include <stdio.h>
#include <stdlib.h>

namespace Ui {
class GpsRecorder;
}

class GpsRecorder : public QWidget
{
    Q_OBJECT

public:
    explicit GpsRecorder(QWidget *parent = 0);
    void setPosMark(int mark);
    void setPosFlag(int flag);
    void recordStart();
    ~GpsRecorder();

public slots:
    void saveNewPos(double x, double y, QString yaw, QString speed, QString latitude, QString longitude);//x坐标-y坐标-偏航角-速度-纬度-经度
    void saveMap();

signals:
    void readyRecorder();
    void newMapPoint(double x, double y, QString yaw, QString speed, QString latitude, QString longitude, int posType);

private slots:
    void showEvent(QShowEvent*);
    void on_ok_clicked();
    void on_back_clicked();
    void on_browse_clicked();

private:
    Ui::GpsRecorder *ui;
    RecordConfig* rConfig;
    quint64 posNum;
    QTime scanTime;
    int posMark;
    int posFlag;
//    QFile* f;
    FILE* f;
};

#endif // GPSRECORDER_H
